package org.budo.microsoft.api.response;

import org.budo.support.http.client.Response;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author lmw
 */
public class TokenInfoResponse extends AbstractResponse {
    private static final long serialVersionUID = -8045816056890940647L;

    public TokenInfoResponse() {}

    public TokenInfoResponse(Response response) {
        this.setResponse(response);

        String responseBody = response.getBody();
        JSONObject responseJson = JSON.parseObject(responseBody);

        this.setResponseJson(responseJson);
    }

    public String getUid() {
        return this.getResponseJson().getString("uid");
    }
}